import {request} from "@@/plugin-request/request";
import {antSortToApiParams} from "@/utils/apiUtil";
import type {HospitalSetItem} from "@/pages/HospitalSet/models/hospitalSet.model";


/** 获取规则列表 GET /api/rule */
export async function hospitalSetIndex(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  },
  sort?: Record<string, any>,
  filter?: Record<string, string[]>
) {
  const moreQuery = antSortToApiParams(sort, filter)
  return request<API.ResultWithPage<HospitalSetItem>>('/api-admin/hosp/hospitalSet', {
    method: 'GET',
    params: {
      ...params,
      ...moreQuery
    },
  });
}

export async function updateHospitalSet(hospitalSetItem: Partial<HospitalSetItem>,method='POST') {
  return request('/api-admin/hosp/hospitalSet', {
    method,
    data:hospitalSetItem
  })
}
